const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
    mode:'production',  // development production
    entry:{
        'setting':'./src/setting/setting.js',  //系统配置
        'treasure-list':'./src/treasure/list.js',  //宝藏列表
        'treasure-add':'./src/treasure/add.js',  //添加宝藏
        'activity-list':'./src/activity/list.js',  //活动列表
        'activity-edit-default':'./src/activity/edit-default.js',  //新增修改普通模式的活动
        'activity-edit':'./src/activity/edit.js',  //创建或者修改活动
        'finance-list':'./src/finance/finance-list.js',  //提现兑换列表
        'member-list':'./src/member/list.js',  //会员列表
        'store-list':'./src/store/list.js',   //门店列表
        "skin-list":"./src/skin/list/index.js"   //地图皮肤列表
    },
    output:{
        path:path.dirname(__dirname)+'/server/dist/web/',
        filename:'[name].js',
        publicPath:'../addons/kuyuan_vbz/dist/web/'
    },
    devtool:'inline-source-map',
    plugins:[
        new CleanWebpackPlugin([path.dirname(__dirname)+'/server/dist/web/*'])
    ],
    module:{
        rules:[
            {
                test:/\.(png|jpeg|jpg|gif|svg|eot|ttf|woff|woff2)$/,
                use:{
                    loader:'file-loader',
                    options:{
                        name:'image/[name]-[hash:6].[ext]'
                    }
                }
            },
            {
                test:/\.css$/,
                use:["style-loader","css-loader"]
            }
        ]
    },
    resolve:{
        alias:{
            'vue':'vue/dist/vue.common.js'
        }
    }
}